//
//  KBSectionHeaderView.m
//  喜马拉雅改良版框架
//
//  Created by dllo on 15/12/23.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "KBSectionHeaderView.h"

@implementation KBSectionHeaderView


-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubviews];
    }
    
    return self;
}

-(void)createSubviews
{
    self.backgroundColor = [UIColor whiteColor];
    
    self.arrowImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10,10,10,10)];
    self.arrowImageView.backgroundColor = [UIColor clearColor];
    self.arrowImageView.image = [UIImage imageNamed:@"findsection_logo@2x.png"];
    [self addSubview:self.arrowImageView];
    
    [_arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.left.top.mas_equalTo(10);
    }];

    
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.arrowImageView.frame.origin.x + self.arrowImageView.frame.size.width + 10, self.arrowImageView.frame.origin.y-5, 200, 20)];
    self.titleLabel.backgroundColor = [UIColor clearColor];
    self.titleLabel.textColor = [UIColor colorWithRed:0.48 green:0.48 blue:0.48 alpha:1];
    [self addSubview:self.titleLabel];
    
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.left.equalTo(_arrowImageView.mas_right).offset(10);
        make.top.equalTo(_arrowImageView.mas_top).offset(-5);
        make.size.mas_equalTo(CGSizeMake(200, 20));
        
    }];
    

    self.moreButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.moreButton.frame = CGRectMake(self.frame.size.width - 40, self.arrowImageView.frame.origin.y-3 , 30, 15);
    self.moreButton.backgroundColor = [UIColor clearColor];
    [self.moreButton setImage:[UIImage imageNamed:@"liveRadioSectionMore_Normal@2x.png"] forState:UIControlStateNormal];
    [self.moreButton setImage:[UIImage imageNamed:@"liveRadioSectionMore_High@2x.png"] forState:UIControlStateHighlighted];
    [self addSubview:self.moreButton];
    [_moreButton mas_makeConstraints:^(MASConstraintMaker *make) {
            
            make.left.mas_equalTo(self.frame.size.width - 40);
            make.top.mas_equalTo(7);
            make.size.mas_equalTo(CGSizeMake(30, 15));
            
    }];

    
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
